# Arch Linux PKGBUILD for RuneMage
# Maintainer: Ricky Thomson <punkrockunix@gmail.com>

pkgname=runemage
pkgver='0.7.0'
pkgrel='1'
pkgdesc='An unofficial runescape client written in Perl'
arch=('any')
url='http://runemage.googlecode.com/'
license=('GPL' 'CC-BY')
depends=('perl-libwww' 'perl-gtk2-mozembed' 'perl-xml-simple' 'gtk2-perl')

optdepends=('java-runtime: to be able to play runescape'
	    'icedtea-web: required if you use openjdk as your java-runtime')

md5sums=('03126bd02986d8dff5e88f8dd6e05a5a')
source=("$url/files/$pkgname-$pkgver.tar.gz")


build() {

  cd "${srcdir}/${pkgname}-${pkgver}"

  sed -i "s|\$Bin\ .\ \"|\"/opt/runemage|" runemage.pl

  install -Dm755 runemage.pl \
    ${pkgdir}/opt/${pkgname}/runemage.pl


  install -Dm644 data/runemage.xml \
    ${pkgdir}/opt/${pkgname}/data/runemage.xml

  install -Dm644 data/start.html \
    ${pkgdir}/opt/${pkgname}/data/start.html

  install -Dm644 data/swords.png \
    ${pkgdir}/opt/${pkgname}/data/swords.png

  install -Dm644 data/runemage.desktop \
    ${pkgdir}/usr/share/applications/runemage.desktop

}


package() {

  mkdir -p ${pkgdir}/usr/bin
  ln -s "/opt/runemage/runemage.pl" "${pkgdir}/usr/bin/runemage"

}

